package com.example.robertluozizhao.java.design.prototype;

/**
 *
 * 原型模式（创建型）
 */
public class TestResult {
    public static void main(String args[]) {

        ProtoTypeBean protoTypeBean = new ProtoTypeBean("原型模式Test",1);

        try {
            ProtoTypeBean clone = (ProtoTypeBean) protoTypeBean.clone();
            System.out.println(protoTypeBean.hashCode()+":"+protoTypeBean.toString());
            System.out.println(clone.hashCode()+":"+clone.toString());

        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }

    }
}
